package com.bharat.services;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.transaction.annotation.Transactional;

import com.bharat.dao.IPatientDao;
import com.bharat.domain.Patient;

public class PatientService {

	private final Logger log = Logger.getLogger(PatientService.class);

	private IPatientDao patientDao;

	public void setPatientDao(IPatientDao patientDao) {
		this.patientDao = patientDao;
	}

	@Transactional
	public int createPatient(Patient patient) {
		log.info(patient);
		int status = this.patientDao.createPatient(patient);
		return status;
	}

	@Transactional
	public List<Patient> getAllPatients() {
		List<Patient> patients = new ArrayList<Patient>();
		patients = this.patientDao.getAllPatients();
		return patients;
	}
}
